1. Field of the Invention
The system of the present invention is related to the field of automated testing of computer systems and computer software. Specifically, the system of the present invention relates to the field of automated testing of window-based systems.
2. Background of the Invention
To test computer system hardware and software, a script of user actions is developed which reflect actions taken by a user during a typical user session. An action may be, for example, moving the cursor, typing information, or depressing a button on the mouse. The actions listed in the script are manually entered into the computer system and the results output by the computer system are analyzed to determine if the system performed as expected. Running controlled tests in this manner is difficult. Each time the script is run, the test itself may be different because it is hard to replicate the user actions precisely. In addition, some test results are hard to compare by visual examination. For example, it is very difficult to compare screen images to determine pixel accuracy.
A method that has been used for testing software is a record and playback mechanism known as journaling. Journaling is the process of recording a series of user actions reflected in the system as "events," storing them in a file, often referred to as a journal file, and replaying the recorded event to simulate a user session by causing the system to re-execute the recorded events representative of the user actions. (See for example, CAPBAK/UNIX Terminal Session Capture and Playback for UNIX Systems, Software Research Inc., (1989). The journaling systems typically addressed a single input device, i.e. the keyboard, which provided input to a single process and does not perform adequately in a multi-input, multi-process environment.
In a window-based computer system, such as those marketed by Sun Microsystems, Inc., Mountain View, Calif., a user may interact, through a variety of input devices, with a plurality of applications concurrently operating in a plurality of windows on a display. Window-based systems introduced added complexity to the journaling process. In a window-based system, a number of input devices and a number of processes interact with one another in a predetermined sequence in order to produce a desired effect such as selecting a client or application process from a menu or moving the cursor from one window to another. In an attempt to maintain a proper sequence, a time delay is inserted between various actions recorded in the journal file to increase the amount of time between execution of actions. By scaling the time between events, it is generally possible to maintain the proper execution sequence of actions taken by the input devices and processes. However, playing actions faster than the speed they were initially recorded, as is done typically on playback of a journal file, can lead to unexpected behavior. This unexpected behavior arises because of race conditions caused by a second process executing prior to the completion of execution of a first process, wherein the final state of the first process is utilized by the second process.